package com.ithuaxin.identifier;

import java.util.Scanner;

public class Sum3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数字用来表示最小范围");
        int min = sc.nextInt();
        System.out.println("请输入第二个数字用来表示最大范围");
        int max = sc.nextInt();
        int sum=0;
        int count=0;
        for (int i=min;i<=max;i++){
            if (i%3==0&&i%5==0){
                sum = sum+i;
                count=count+1;
            }
        }
        System.out.println("该范围内满足条件的数字和为"+sum);
        System.out.println("该范围内满足条件的数字个数为"+count);
    }
}
